<template>
  <div class="header">
   <div class="header-left">
      <span class="iconfont left-icon">&#xe624;</span>
    </div>
    <div class="header-input">
      <span class="iconfont search-icon">&#xe632;</span>
      <input type="text" class="header-search-input" placeholder="输入城市/景点/游玩主题" />
    </div>
    <router-link to="/city">
      <div class="header-right">
        <span>{{this.city}}</span>
        <span class="iconfont right-icon">&#xe650;</span>
      </div>
    </router-link>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  name: 'HomeHeader',
  computed: {
    ...mapState(['city'])
  }
}
</script>

<style lang="stylus" scoped>
@import '~styles/variable.styl'
	.header
		display: flex;
		height: .88rem;
		line-height: .88rem;
		background: $bgColor;
		color: #fff;
		font-size: .24rem;
		.header-left
			width: .6rem;
			float: left;
			text-align: center;
			font-size: .3rem;
			font-weight: bold;
			.left-icon
				margin-top: .1rem;
		.header-input
			flex: 1;
			margin-left: .2rem;
			position: relative;
			color: #ebeff0;
			.search-icon
				position: absolute;
				left: .2rem;
			.header-search-input
				width: 100%;
				height: .6rem;
				border-radius: .05rem;
				text-indent: .64rem;
				color: #434343;
				font-weight: bold;
			input::-webkit-input-placeholder
					color: #e7ebed;
		.header-right
			min-width: 1.04rem;
			padding: 0 .1rem
			float: right;
			text-align: center;
			font-weight: bold;
			font-size: 0;
			color: #fff
			span
				font-size: .25rem;
			.right-icon
				font-size: .3rem;
</style>
